package com.cjm.one.webmanager.service.goods.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.goods.client.GoodsBrandClient;
import com.cjm.one.model.goods.entity.GoodsBrand;
import com.cjm.one.model.goods.vo.GoodsBrandVo;
import com.cjm.one.webmanager.service.goods.GoodsBrandService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class GoodsBrandServiceImpl implements GoodsBrandService {
    @Resource
    private GoodsBrandClient goodsBrandClient;
    @Override
    public Page<GoodsBrandVo> pageByName(Integer current, Integer size, String name) {
        return goodsBrandClient.page(current,size,name).getData();
    }

    @Override
    public GoodsBrandVo getById(Long id) {
        return goodsBrandClient.getById(id).getData();
    }

    @Override
    public Boolean save(GoodsBrand goodBrand) {
        return goodsBrandClient.save(goodBrand).getData();
    }

    @Override
    public Boolean updateById(GoodsBrand goodBrand) {
        return goodsBrandClient.update(goodBrand).getData();
    }

    @Override
    public Boolean removeById(Long id) {
        return goodsBrandClient.delete(id).getData();
    }

    @Override
    public ArrayList<GoodsBrandVo> listAll() {
        return goodsBrandClient.listAll().getData();
    }
}
